// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import { RestoreInput } from '../models';
// 定义 API 路径枚举
enum Api {
    SysUpdateClear = '/sysUpdate/clear',
    SysUpdateList = '/sysUpdate/list',
    SysUpdateLogs = '/sysUpdate/logs',
    SysUpdateRestore = '/sysUpdate/restore',
    SysUpdateUpdate = '/sysUpdate/update',
    SysUpdateWebHookKey = '/sysUpdate/webHookKey',
    SysUpdateWebHook = '/sysUpdate/webHook',
}

// 定义 API 方法
export const apiSysUpdateClearGet = () =>
    request({
        url: Api.SysUpdateClear,
        method: 'get',
    });

export const apiSysUpdateListPost = () =>
    request({
        url: Api.SysUpdateList,
        method: 'post',
    });

export const apiSysUpdateLogsGet = () =>
    request({
        url: Api.SysUpdateLogs,
        method: 'get',
    });

export const apiSysUpdateRestorePost = (body?: RestoreInput) =>
    request({
        url: Api.SysUpdateRestore,
        method: 'post',
        data: body,
    });

export const apiSysUpdateUpdatePost = () =>
    request({
        url: Api.SysUpdateUpdate,
        method: 'post',
    });

export const apiSysUpdateWebHookKeyGet = () =>
    request({
        url: Api.SysUpdateWebHookKey,
        method: 'get',
    });

export const apiSysUpdateWebHookPost = (body?: { [key: string]: any }) =>
    request({
        url: Api.SysUpdateWebHook,
        method: 'post',
        data: body,
    });